import axios from 'axios'

export default {
    // 命名空间
    namespace: 'about',
    // 定义初始数据
    state: [],
    // 同步修改数据
    reducers: {
        set(state, action) {
            state = action.res
            return [ ...state ];
        },
        connect(state, action) {
            state = state.concat((action.list))
            return [ ...state ];
        }
    },
    effects: {
        *init({ payload }, { call, put }) {  // eslint-disable-line
            let res = yield axios.get('/getList')
            yield put({ type: "set", res: res.data})
        },
    },


    subscriptions: {
      setup({ dispatch, history }) {  // eslint-disable-line
        dispatch({ type: "init" })
      }
    },

    
}